Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@tabula/ui-button
Advanced tools
Button components which are used to initialize an action.
Use the package manager pnpm to install @tabula/ui-button
.
pnpm add @tabula/ui-button
We provide five different button sizes with own visual styles:
UiButton20
UiButton24
UiButton32
UiButton40
UiButton48
Import required component and render it with one of supported variants:
import { FC, MouseEventHandler, PropsWithChildren } from 'react';
import { UiButton24 } from '@tabula/ui-button';
type Props = PropsWithChildren<{
onClick: MouseEventHandler<HTMLButtonElement>;
}>;
const Action: FC<Props> = ({ children, onClick }) => (
<UiButton24 onClick={onClick} variant='primary'>{children}</UiButton24>
)
The component supports four types: button
, a
, div
and link
. By default, the button
type is used.
By default, the component renders generic button:
<UiButton24 variant="primary">Default</UiButton24>
You can provide as="button"
explicitly:
<UiButton24 as="button" variant="primary">Button</UiButton24>
You can render a
element with providing as="button"
:
<UiButton24 as="a" href="#" target="_blank" variant="primary">Anchor</UiButton24>
In rare cases, you can render div
element with providing as="div"
:
<UiButton24 as="div" variant="primary">Div</UiButton24>
You can use as="link"
and provide component
property to use react-router
's Link
component:
import { Link } from 'react-router-dom';
<UiButton24 as="link" component={Link} target="_blank" to="#" variant="contract">Link</UiButton24>
It can be useful, when you want to have div
element with button appearance. For example, to render it inside
another button
element.
Each button component has its own appearance variants list, which you can use:
UiButton20
: contract
;UiButton24
: primary
, secondary
, cancel
, cancelFilled
, edit
, test
and ai
;UiButton32
: primaryDesign
, secondaryDesign
, primaryList
, secondaryList
, dangerousList
and shadowList
;UiButton40
: primary
, secondary
, secondaryBlue
and secondaryFilled
;UiButton48
: primary
and secondary
;The component supports a few options.
isDisabled
This property allows to disable button:
<UiButton24 isDisabled variant="primary">Button</UiButton24>
isFrozen
This property allows to disable button, but keep enabled look and feel:
<UiButton24 isFrozen variant="primary">Button</UiButton24>
isDisabled
and isFrozen
The isDisabled
styles has priority over isFrozen
when they're used together.
<UiButton24 isDisabled isFrozen variant="primary">Button</UiButton24>
icon
You can provide an icon component:
import { UiDateIcon } from '@tabula/ui-data-type-icon';
<UiButton24 icon={UiDateIcon} variant="primary">Open calendar</UiButton24>
We recommend use icons with size of 16x16
.
An icon component should support className
property.
All component types supports relevant HTML attributes, excluding aria-disabled
and disabled
. These attributes are
controlled by the component itself.
Also href
attribute is restricted link
type.
For example, you can provide data-*
attribute for analytics purposes:
<UiButton24 data-track-id="button" variant="primary">Button</UiButton24>
This project is ISC licensed.
FAQs
Button components which are used to initialize an action
The npm package @tabula/ui-button receives a total of 85 weekly downloads. As such, @tabula/ui-button popularity was classified as not popular.
We found that @tabula/ui-button demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.